Mysql 常用命令
查询表结构信息
1 | **表结构,字段类型,主键,是否为空等属性** |
查看表生成的DDL
1 | show create table table_name; |
Mysql 新建用户及赋权
1 | **创建用户** |
修改密码
1 | alter user 'operator'@'localhost' IDENTIFIED BY 'password'; |
###
查询用户详细信息
1 | use mysql; |
Postgresql常用命令
基础操作
查询数据库、表大小信息
1 | select pg_size_pretty(pg_database_size('prometheus')); #查看数据库大小 |
创建只读用户
1 | -- Create a group |
创建用户及数据库
1 | create role grafana with login password '1qaz@PASSW0RD'; |